home *** CD-ROM | disk | FTP | other *** search
/ Solaris Press Kit / Solaris Press Kit.iso / mac / Media / Solaris.dxr / Internal_18_Copy Photos.ls < prev    next >
Encoding:
Text File  |  2002-10-23  |  1.9 KB  |  60 lines

  1. global gbPC, gRootPath, gPicNo
  2.  
  3. on mouseUp me
  4.   setCursorWait()
  5.   updateStage()
  6.   fxObj = xtra("FileXtra3").new()
  7.   if gbPC then
  8.     dtPath = fxObj.fx_FolderGetSpecialPath("CSIDL_DESKTOPDIRECTORY")
  9.   else
  10.     dtPath = fxObj.fx_FolderGetSpecialPath("kDesktopFolderType")
  11.   end if
  12.   if dtPath = EMPTY then
  13.     alert("Error finding desktop folder" & RETURN & "Error:" && fxObj.fx_ErrorNumber() & RETURN & fxObj.fx_ErrorString())
  14.     fxObj = 0
  15.     exit
  16.   end if
  17.   DestFolder = dtPath & "Solaris"
  18.   if not fxObj.fx_FolderExists("destFolder") then
  19.     res = fxObj.fx_FolderCreate(DestFolder)
  20.     if res = 0 then
  21.       alert("Error creating folder on desktop" & RETURN & "Error:" && fxObj.fx_ErrorNumber() & RETURN & fxObj.fx_ErrorString())
  22.       fxObj = 0
  23.       exit
  24.     end if
  25.   end if
  26.   picFilename = member("filenames").line[gPicNo].word[1]
  27.   destPath = DestFolder & picFilename
  28.   if gbPC then
  29.     SrcPath = gRootPath & "Photos\" & picFilename
  30.     destPath = DestFolder & "\" & picFilename
  31.     srcDoc = gRootPath & "Photos\Captions.doc"
  32.     destDoc = DestFolder & "\Captions.doc"
  33.   else
  34.     SrcPath = gRootPath & "Photos:" & picFilename
  35.     destPath = DestFolder & ":" & picFilename
  36.     srcDoc = gRootPath & "Photos:Captions.doc"
  37.     destDoc = DestFolder & ":Captions.doc"
  38.   end if
  39.   res = fxObj.fx_FileCopy(srcDoc, destDoc)
  40.   if res = 0 then
  41.     alert("Error copying file" & RETURN & "Error:" && fxObj.fx_ErrorNumber() & RETURN & fxObj.fx_ErrorString())
  42.     fxObj = 0
  43.     exit
  44.   end if
  45.   res = fxObj.fx_FileCopy(SrcPath, destPath)
  46.   if res = 0 then
  47.     alert("Error copying file" & RETURN & "Error:" && fxObj.fx_ErrorNumber() & RETURN & fxObj.fx_ErrorString())
  48.     fxObj = 0
  49.     exit
  50.   end if
  51.   fxObj = 0
  52.   setCursorStop()
  53.   updateStage()
  54.   alertObj = new(xtra("MUI"))
  55.   alertInitList = [#Buttons: #Ok, #default: 1, #title: "Download", #Message: "Saved '" & picFilename & "' to Desktop ", #movable: 1]
  56.   if objectp(alertObj) then
  57.     result = alert(alertObj, alertInitList)
  58.   end if
  59. end
  60.